import api from '../http'

export const insertOrder = (data) => {
	return api.http({
		url:'/shop/order/insert',
		method:'put',
		data
	})
}

export const insertOrderFromBuyCar = (data) => {
	return api.http({
		url:'/shop/order/insert/buy-car',
		method:'put',
		data
	})
}

export const getOrderListByUserForPage = (params) => {
	return api.http({
		url:'/shop/order/list/page/user',
		method:'get',
		params
	})
}


export const findOrderByOrderNo = (orderNo) => {
	return api.http({
		url:`/shop/order/find/orderNo/${orderNo}`,
		method:'get',
	})
}

export const getGoods = (id) => {
	return api.http({
		url:`/shop/order/get/goods`,
		method:'get',
		params:{id}
	})
}

export const fallbackGoods = (data) => {
	return api.http({
		url:'/shop/order/fallback/goods',
		method:'post',
		data
	})
}

export const updateFromTeam = (params) => {
	return api.http({
		url:`/shop/order/update/team/id/${params.id}/password/${params.password}`,
		method:'put'
	})
}

export const deleteOrder = (id) => {
	return api.http({
		url:`/shop/order/delete-order/id/${id}`,
		method:'delete'
	})
}